if(USE_THREADS STREQUAL "GTHREADS")
    pkg_check_modules(GTHREAD REQUIRED gthread-2.0>=2.0)
    set(THREADS_INCLUDE_DIRS ${GTHREAD_INCLUDE_DIRS})
    set(THREADS_LIBRARIES ${GTHREAD_LIBRARIES})

    set(USE_THREADS_GTHREADS TRUE)
    mark_as_advanced(USE_THREADS_GTHREADS)
endif(USE_THREADS STREQUAL "GTHREADS")

if(USE_THREADS STREQUAL "NONE")
    set(USE_THREADS_NONE TRUE)
    mark_as_advanced(USE_THREADS_NONE)
endif(USE_THREADS STREQUAL "NONE")

if(USE_THREADS STREQUAL "PTHREADS")
    set(THREADS_LIBRARIES pthread)

    set(USE_THREADS_PTHREADS TRUE)
    mark_as_advanced(USE_THREADS_PTHREADS)
endif(USE_THREADS STREQUAL "PTHREADS")

if(USE_THREADS STREQUAL "QT")
    pkg_check_modules(QTTHREAD REQUIRED QtCore)
    set(THREADS_INCLUDE_DIRS ${QTTHREAD_INCLUDE_DIRS})
    set(THREADS_LIBRARIES ${QTTHREAD_LIBRARIES})
    set(THREADS_LIBRARY_DIRS ${QTTHREAD_LIBRARY_DIRS})

    set(USE_THREADS_QT TRUE)
    mark_as_advanced(USE_THREADS_QT)
endif(USE_THREADS STREQUAL "QT")
